import requst from '@/utils/request'
import type { CategoryResponseData } from './type'
// 统一商品属性管理模块儿接口地址
enum API {
  // 一级分类接口地址
  C1_URL = '/admin/product/getCategory1',
  // 二级分类接口地址
  C2_URL = '/admin/product/getCategory2/',
  // 三级分类接口地址
  C3_URL = '/admin/product/getCategory3/',
}

// 一级分类接口
export const reqC1 = () => {
  return requst.get<any, CategoryResponseData>(API.C1_URL)
}
// 二级分类接口
export const reqC2 = (category1Id: string | number) => {
  return requst.get<any, CategoryResponseData>(API.C1_URL + category1Id)
}
// 三级分类接口
export const reqC3 = (category2Id: string | number) => {
  return requst.get<any, CategoryResponseData>(API.C1_URL + category2Id)
}
